<template>
    <div>
    <!-- <a-button @click="pagezoomout">放大</a-button> <a-button @="pagezoomin">缩小</a-button> -->
      <vue-pdf-embed :source="source2" />
      <!-- <vue-pdf-embed src="../../../public/尹咨怡-平面设计师.pdf"></vue-pdf-embed> -->
    </div>
  </template>
  
  <script>
  import VuePdfEmbed from 'vue-pdf-embed/dist/vue2-pdf-embed'
  
  export default {
    components: {
      VuePdfEmbed,
    },
    data() {
      return {
        source2: '',
        scale:1
      }
    },
    mounted() {
      this.loadBase64Data();
    },
    methods: {
      async loadBase64Data() {
        try {
          const response = await this.$http.get('/node.txt');
          console.log(response);
          this.source2 = `data:application/pdf;base64,${response.data}`;
        } catch (error) {
          console.error('Error loading base64 data:', error);
          console.log(error);
        }
      },
      // pagezoomout(){
      //   if(this.scale<2){
      //     this.scale+=0.1;
      //     console.log(this.scale);
      //   }
      // },
      // pagezoomin(){
      //   if(this.scale>1){
      //     this.scale-=0.1;
      //     console.log(this.scale);
      //   }
      // }
    }
  }
  </script>
  <style scoped>
  </style>